Lecture #3: Transforming and Combining Functions

MATH 145 – Calculus I

Torin Quinlivan

Knox College

September 4, 2025

More Complex Functions

Last time, we discussed some of the basic types of functions.

We also discussed compositions, one of the ways to combine simpler functions to make more complicated ones.

There are more ways to combine or change functions.

Piecewise Functions

A piecewise function is a function that has different formulas on different intervals.

Example: The absolute value function \(f(x) = \vert x \vert\) returns \(x\) if \(x\) is positive, and \(-x\) if \(x\) is negative. We can write this as: \[ f(x) = \begin{cases} -x & \textrm{if } x < 0 \\ x & \textrm{if } x \ge 0 \\ \end{cases} \]

Piecewise Functions

Example: \[ f(x) = \begin{cases} x + 3 & \textrm{if } x < 2 \\ x^2 & \textrm{if } 2 \le x \le 4 \\ 2x - 4 & \textrm{if } x > 4 \end{cases} \]

Evaluate \(f(1)\), \(f(2)\), \(f(3)\), \(f(4)\) and \(f(5)\).

Graph \(f(x)\).

Piecewise Functions

Example: Determine the formula for the piecewise function shown below:

Piecewise Functions

Example: Determine the formula for the piecewise function shown below:

Combining Functions with Algebraic Operations

You can perform algebraic operations on functions, just like you can perform algebraic operations on numbers.

Let \(f\) and \(g\) be functions that share the same domain. Then:

  • The sum of \(f\) and \(g\) is the function \(f + g\) defined by \((f + g)(x) = f(x) + g(x)\).

  • The difference of \(f\) and \(g\) is the function \(f - g\) defined by \((f - g)(x) = f(x) - g(x)\).

  • The product of \(f\) and \(g\) is the function \(f \cdot g\) defined by \((f \cdot g)(x) = f(x) \cdot g(x)\).

  • The quotient of \(f\) and \(g\) is the function \(\frac{f}{g}\) defined by \((\frac{f}{g})(x) = \frac{f(x)}{g(x)}\) for all \(x\) such that \(g(x) \ne 0\).

Combining Functions with Algebraic Operations

Let \(f\) and \(g\) be functions that share the same domain. Then:

  • The sum of \(f\) and \(g\) is the function \(f + g\) defined by \((f + g)(x) = f(x) + g(x)\).

  • The difference of \(f\) and \(g\) is the function \(f - g\) defined by \((f - g)(x) = f(x) - g(x)\).

  • The product of \(f\) and \(g\) is the function \(f \cdot g\) defined by \((f \cdot g)(x) = f(x) \cdot g(x)\).

  • The quotient of \(f\) and \(g\) is the function \(\frac{f}{g}\) defined by \((\frac{f}{g})(x) = \frac{f(x)}{g(x)}\) for all \(x\) such that \(g(x) \ne 0\).

This is mainly about notation, but this notation will allow us to simplify functions for calculus formulas. If you can notice when a function is a combination of two simpler ones, it may help make future things easier.

Piecewise Functions

Example: Let \(f(x) = 2x + 3\), \(g(x) = x^3\) and \(h(x) = \sin(x)\). (Assume all functions share the domain of \(\mathbb{R}\).)

Find:

  1. \((f + g)(x)\).

  2. \((h - f)(x)\).

  3. \((g \cdot f)(2)\).

  4. \(\left( \frac{f}{g} \right)(5)\). Where is this undefined?

  5. \(\left( \frac{f}{h} \right)(x)\). Where is this undefined?

  6. \((h \cdot (g - f))(x)\).

Translating Functions

Suppose we have the function \(f(x) = x^2\). If I want to move the whole graph 3 units upwards (i.e. in the positive \(y\)-direction), how could I do it?

We want to send \((x,\, y)\) to \((x,\, y+3).\)

Given a function \(y = f(x)\) and a real number \(a\), the transformed function \(y = g(x) = f(x) + a\) is a vertical translation on the graph of \(f\). That is, every point \((x, f(x))\) on the graph of \(f\) gets shifted vertically to the corresponding point \((x, f(x) + a)\) on the graph of \(h\).

Translating Functions

Suppose we have the function \(f(x) = x^2\). Now if I want to move the whole graph 3 units to the right (i.e. in the positive \(x\)-direction), how could I do it?

We want to send \((x,\, y)\) to \((x+3,\, y).\)

Given a function \(y = f(x)\) and a real number \(b\), the transformed function \(y = h(x) = f(x + b)\) is a horizontal translation on the graph of \(f\). That is, every point \((x, f(x))\) on the graph of \(f\) gets shifted horizonally to the corresponding point \((x + b, f(x))\) on the graph of \(h\).

Translating Functions Example

Example: On the same axes as the plot of \(r\), sketch the following graphs. Be sure to label the point on each of \(f\), \(g\) and \(h\) that corresponds to \((-2,\,-1)\) on the original graph of \(r\).

  1. \(y = f(x) = r(x) + 2\)

  2. \(y = g(x) = r(x + 1)\)

  3. \(y = h(x) = r(x + 1) + 2\)

Translating Functions Example

Translating Functions Example

Example: On the same axes as the plot of \(s\), sketch the following graphs. Be sure to label the point on each of \(j\), \(k\) and \(\ell\) that corresponds to \((-2,\,-3)\) on the original graph of \(s\).

  1. \(y = j(x) = s(x) - 1\)

  2. \(y = k(x) = s(x - 2)\)

  3. \(y = \ell(x) = s(x - 2) - 1\).

Translating Functions Example

Vertical Scaling of a Function

Given a function \(y = f(x)\) and a real number \(c > 0\), the transformed function \(y = v(x) = cf(x)\) is a vertical stretch of the graph of \(f\). Every point \((x, f(x))\) on the graph of \(f\) gets stretch vertically to the corresponding point \((x, cf(x))\) on the graph of \(v\). If \(0 < c < 1\), the graph of \(v\) is a compression of \(f\) toward the \(x\)-axis; if \(c > 1\), the graph of \(v\) is a stretch of \(f\) away from the \(x\)-axis. Points where \(f(x) = 0\) are unchanged by the transformation.

Given a function \(y = f(x)\) and a real number \(c < 0\), the transformed function \(y = v(x) = cf(x)\) is a reflection of the graph of \(f\) across the \(x\)-axis followed by a vertical stretch by a factor of \(\vert c \vert\).

Vertical Scaling of a Function Example

Example: On the same axes as the plot of \(r\), sketch the following graphs. Be sure to label the point on each of \(f\), \(g\) and \(h\) that corresponds to \((-2,\,-1)\) on the original graph of \(r\).

  1. \(y = f(x) = 3r(x)\)

  2. \(y = g(x) = \frac{1}{3}r(x)\)

Vertical Scaling of a Function Example

Vertical Scaling of a Function Example

Example: On the same axes as the plot of \(s\), sketch the following graphs. Be sure to label the point on each of \(j\), \(k\) and \(\ell\) that corresponds to \((-2,\,-3)\) on the original graph of \(s\).

  1. \(y = j(x) = -2s(x)\)

  2. \(y = k(x) = -\frac{1}{2}s(x)\)

Vertical Scaling of a Function Example

Horizontal Scaling of a Function

Given a function \(y = f(x)\) and a real number \(c > 0\), the transformed function \(y = h(x) = f(cx)\) is a horizontal stretch of the graph of \(f\). Every point \((x, f(x))\) on the graph of \(f\) gets stretch vertically to the corresponding point \((x, f(cx))\) on the graph of \(h\). If \(0 < c < 1\), the graph of \(v\) is a compression of \(f\) toward the \(y\)-axis; if \(c > 1\), the graph of \(h\) is a stretch of \(f\) away from the \(y\)-axis. Points where \(x = 0\) are unchanged by the transformation.

Given a function \(y = f(x)\) and a real number \(c < 0\), the transformed function \(y = h(x) = f(cx)\) is a reflection of the graph of \(f\) across the \(y\)-axis followed by a horizontal stretch by a factor of \(\vert c \vert\).

Horizontal Scaling of a Function Example

Example: On the same axes as the plot of \(r\), sketch the following graphs. Be sure to label the point on each of \(f\), \(g\) and \(h\) that corresponds to \((-2,\,-1)\) on the original graph of \(r\).

  1. \(y = f(x) = r(3x)\)

  2. \(y = g(x) = r(\frac{1}{3}x)\)

Horizontal Scaling of a Function Example

Horizontal Scaling of a Function Example

Example: On the same axes as the plot of \(s\), sketch the following graphs. Be sure to label the point on each of \(j\), \(k\) and \(\ell\) that corresponds to \((-2,\,-3)\) on the original graph of \(s\).

  1. \(y = j(x) = s(-2x)\)

  2. \(y = k(x) = s(-\frac{1}{2}x)\)

Horizontal Scaling of a Function Example

Translating Functions Example

Example: Above is the graph of \(y = f(x) = x^2\). What does the transformation \(y = g(x) = 2 f\left(\frac{1}{2}x + 3\right) - 4\) do to the graph of \(f\)?